package com.codi.bus.core.dao;

import com.codi.base.dao.BaseDAO;
import com.codi.bus.core.domain.TradeOrder;
import com.codi.bus.core.service.model.FixBankModel;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface TradeOrderDao extends BaseDAO<TradeOrder> {
    void add(TradeOrder entity);

    void updateOrder(TradeOrder entity);

    TradeOrder getEntityByOrderId(Long orderId);

    List<TradeOrder> getTradeOrderByUserId(Long userId);

    void updateStatus(TradeOrder entity);

	/**
	 * 根据定投协议号查询银行信息
	 * @param list 定投协议号列表
	 * @return
	 */
	List<FixBankModel> selectBankInfoByScheduledProtocolId(List<String> list);

    BigDecimal getSumByDay(TradeOrder model);

    BigDecimal getSumByMonth(TradeOrder model);

    List<Date> getConfirmDates(String fundCode, Long userId);

    List<Date> getConfirmSellDates(String fundCode, Long userId);

    Integer getCountBeforeConfirmDate(Long userId, Date ConfirmDate);

    Integer getBuyCountByConfirmDate(Date beginDate, Date endDate);

    Integer getSellByConfirmDate(Date beginDate, Date endDate);

    Integer getOffLineByOneWeek(Date beginDate, Long userId, String bankAccount);
}
